#ifndef __SYSTEM_H__
#define __SYSTEM_H__

#include "base.pb.h"
#include "system.pb.h"

#include <string>

enum TimeSetState {
    TIME_NOT_SET,
    TIME_SETTED
};

enum TimezoneSetState {
    TIMEZONE_NOT_SET,
    TIMEZONE_SETTED
};

enum MTPState {
    MTP_OFF,
    MTP_ON
};

enum CPUMode {
    CPU_ONDEMAND,
    CPU_PERFORMANCE
};

struct SdCardInfo {
    bool has_sdcard;
    int available_size;
    int total_size;
};

class System {
public:
    System();
    ~System();

    int handleMessage(WsPacket& ws_packet);
    int setSystemTime(time_t timestamp);
    int setSystemTime(WsPacket& ws_packet);
    int setSystemTimezone(const char* timezone);
    int setSystemTimezone(WsPacket& ws_packet);
    int getSdCardInfo(int elapsed_time);

    void setTimeSetState(TimeSetState state);
    TimeSetState getTimeSetState();
    void setTimezoneSetState(TimezoneSetState state);
    TimezoneSetState getTimezoneSetState();
    int setMTPMode(WsPacket& ws_packet);
    MTPState getMTPState();
    int getMacAddress(char* address);
    SdCardInfo getSdCardAvailableAndTotal();
    int setCpuMode(WsPacket& ws_packet);
    int getCpuMode();
    int getDefaultDeviceName(char* name);
    int setMasterLock(WsPacket& ws_packet);
};


#endif